init -10 python:
        
    class hbox:    
        def __enter__(self):
            ui.hbox()
        def __exit__(self,*args,**kwargs):
            ui.close()    
    
    class vbox:    
        def __enter__(self):
            ui.vbox()
        def __exit__(self,*args,**kwargs):
            ui.close()                
            
            
            
    class GUI:
        
        def ImageMap(self):
            with vbox():
                for strPlaceName in _aPlaces:
                    if _aPlaces[strPlaceName].GetChoices():
                        ui.imagebutton(strPlaceName + '.png', strPlaceName +'_hover.png', clicked=ui.returns(_aPlaces[strPlaceName]),image_style='')
                    else:
                        ui.imagebutton(strPlaceName + '.png', strPlaceName +'.png', clicked=ui.returns(None),image_style='')
                        
            pPlace = ui.interact()
            if pPlace:
                ui.frame(xfill=False, yminimum=None, xalign=0.5, yalign=0.5)
                with vbox():     
                    for pItem in pPlace.GetChoices():
                        ui.textbutton(pItem.GetDisplayName(), clicked=ui.returns(pItem))
                pItem = ui.interact()
                ui.callsinnewcontext(pItem.GetLabel())()
                        
                        
            
        def stats_frame(self):
            ui.frame(xfill=False, yminimum=None, xalign=1.0, yalign=0.0)
            
            with vbox():
                
                ui.text( self.pTamagotchi.strName, size=14)
                
                for pAttribute in self.pTamagotchi.aAttributes.values():
                    if pAttribute.bShow:
                        with vbox():
                            ui.text('%s %d/%s' % (pAttribute.strName,pAttribute.iValue,pAttribute.iMax),size=14)
                            ui.bar(pAttribute.iMax, pAttribute.iValue,
                                xmaximum=140,
                                #left_bar=Frame("rrslider_full.png", 12, 0),
                                #right_bar=Frame("rrslider_empty.png", 12, 0),
                                thumb=None,
                                thumb_shadow=None)
                 
                for strMakeNames in self.pTamagotchi.aMakes:
                    aMake = self.pTamagotchi.aMakes[strMakeNames]
                    ui.textbutton(aMake['DisplayName'], clicked=ui.jumps(strMakeNames),xmaximum=140)
